package com.mall.entity;

import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 商品分类实体
 * 
 * @author Mall Team
 */
@Data
public class Category {
    
    private Long id;
    private String name;
    private Long parentId;
    private Integer level;
    private Integer sort;
    private Integer status;
    private LocalDateTime createTime;
    
    // 子分类列表（用于树形结构）
    private List<Category> children;
    
    /**
     * 分类状态枚举
     */
    public enum Status {
        DISABLED(0, "禁用"),
        ENABLED(1, "启用");
        
        private final Integer code;
        private final String desc;
        
        Status(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        
        public Integer getCode() {
            return code;
        }
        
        public String getDesc() {
            return desc;
        }
    }
}